/*
 * Client.java
 * Copyright (C) Jul 3, 2012 Bora SAYINER
 *
 * This file is part of Design Patterns.
 *
 * Design Patterns is free software: you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License as published by the
 * Free Software Foundation, either version 3 of the License, or (at your
 * option) any later version.
 *
 * Design Patterns is distributed in the hope that it will be useful, but
 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License
 * for more details.
 *
 * You should have received a copy of the GNU Lesser General Public License
 * along with Design Patterns. If not, see &lt;http://www.gnu.org/licenses/&gt;.
 */
package net.samples.strategy;

/**
 * 
 * @author Bora SAYINER
 * @since Jul 3, 2012
 * @version 1.0.0
 */
public class Client {

	private ICommunication communication;

	public Client() {
		this.communication = new EthernetComm();
	}

	public void setCommunicationType(CommType commType) {
		switch (commType) {
		case ETHERNET:
			this.communication = new EthernetComm();
			break;
		case SERIAL:
			this.communication = new SerialComm();
			break;
		case INFRARED:
			this.communication = new InfraRedComm();
			break;
		}
	}

	public void connect() {
		this.communication.connect();
	}

	public String getMessage() {
		return this.communication.getMessage();
	}

}
